package com.jbm.jbmsupplier.model;

import java.io.File;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;

import com.jbm.jbmsupplier.util.GuidCreatorUtil;

import android.os.Environment;
import android.text.format.DateFormat;

public class mediafileInfo {
	protected ArrayList<fileInfo> fileList = new ArrayList<fileInfo>();
	private String name="";
	private String date="";
	private String text="";
	
	public mediafileInfo() {
		date = DateFormat.format("yyyy-MM-dd:hh:mm", new Date()).toString();  
	}
	
	public static String getXmlFileName()
	{
		File skRoot = Environment.getExternalStorageDirectory();
		String pathString = skRoot.getPath()+ File.separator+"mediafileInfo"+File.separator+"mediaCenter.xml";
		return pathString;
	}
	
	public void filesClear()
	{
		fileList.clear();
	}
	public void setDate() {
		SimpleDateFormat sDateFormat = new SimpleDateFormat("yyyy-MM-dd");     
		this.date   =   sDateFormat.format(new java.util.Date());		
	}
	
	public String getDate() {
		return date;
	}
	
	public void setDate(String date) {
		this.date = date;
	}
	
	public String getName() {
		return name;
	}
	
	public void setName(String name) {
		this.name = name;
	}
	
	public void setText(String text) {
		this.text = text;
	}
	
	public String getText() {
		return text;
	}
	
	public fileInfo getFileInfo(int index)
	{
		if(fileList.size() > index)
		{
			fileInfo fInfo = fileList.get(index);
			return fInfo;
		}
		return null;
	}
	
	void addFileInfo(fileInfo fInfo)
	{
		fileList.add(fInfo);
	}
	
	public int getFileCount()
	{
		return fileList.size();
	}
	
	public void removeFileInfo(fileInfo fInfo)
	{
		fileList.remove(fInfo);
		fInfo.Remove();
	}
}

